package com.yuexunit.operationman.nbsy.module.BeforeAnesthesiaVisit.ui;

import android.content.Context;
import android.view.MotionEvent;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;

import com.alibaba.fastjson.JSON;

import com.yuexunit.operationman.nbsy.R;
import com.yuexunit.operationman.nbsy.base.BaseKJActivity;
import com.yuexunit.operationman.nbsy.base.SubmitBean;
import com.yuexunit.operationman.nbsy.config.AppConfig;
import com.yuexunit.operationman.nbsy.module.BeforeAnesthesiaVisit.bean.BeforeAnesthesiaBean;
import com.yuexunit.operationman.nbsy.module.BeforeAnesthesiaVisit.model.impl.BeforeAnesthesiaModel;
import com.yuexunit.operationman.nbsy.module.BeforeAnesthesiaVisit.presenter.IBeforeAnesthesiaPresenter;
import com.yuexunit.operationman.nbsy.module.BeforeAnesthesiaVisit.presenter.impl.BeforeAnesthesiaPresenter;
import com.yuexunit.operationman.nbsy.module.BeforeAnesthesiaVisit.ui.view.IBeforeAnesthesiaView;
import com.yuexunit.operationman.nbsy.widget.LoadingDialog;

import org.kymjs.kjframe.ui.ViewInject;
import org.kymjs.kjframe.utils.PreferenceHelper;

import java.util.HashMap;
import java.util.Map;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by chenss on 2017/8/4 0004.
 */

public class Act_BeforeAnesthesiaState extends BaseKJActivity implements IBeforeAnesthesiaView {

    @Bind(R.id.tv_patient_name)
    TextView tvPatientName;
    @Bind(R.id.tv_patient_sex)
    TextView tvPatientSex;
    @Bind(R.id.tv_patient_visitno)
    TextView tvPatientVisitno;
    @Bind(R.id.tv_patient_disease)
    TextView tvPatientDisease;
    @Bind(R.id.titlebar_docadvice_tv_info)
    LinearLayout titlebarDocadviceTvInfo;
    @Bind(R.id.radio_01_01)
    RadioButton radio0101;
    @Bind(R.id.radio_01_02)
    RadioButton radio0102;
    @Bind(R.id.radio_01)
    RadioGroup radio01;
    @Bind(R.id.radio_01_01_01)
    CheckBox radio010101;
    @Bind(R.id.radio_01_01_02)
    CheckBox radio010102;
    @Bind(R.id.radio_01_01_03)
    CheckBox radio010103;
    @Bind(R.id.radio_01_01_04)
    CheckBox radio010104;
    @Bind(R.id.radio_01_01_05)
    CheckBox radio010105;
    @Bind(R.id.radio_01_01_06)
    CheckBox radio010106;
    @Bind(R.id.radio_01_01_07)
    CheckBox radio010107;
    @Bind(R.id.radio_01_01_08)
    CheckBox radio010108;
    @Bind(R.id.radio_01_01_09)
    CheckBox radio010109;
    @Bind(R.id.radio_01_other_txt)
    EditText radio01OtherTxt;
    @Bind(R.id.iv_radio_01_other)
    LinearLayout ivRadio01Other;
    @Bind(R.id.iv_radio_01)
    LinearLayout ivRadio01;
    @Bind(R.id.radio_02_01)
    RadioButton radio0201;
    @Bind(R.id.radio_02_02)
    RadioButton radio0202;
    @Bind(R.id.radio_02)
    RadioGroup radio02;
    @Bind(R.id.radio_02_01_01)
    CheckBox radio020101;
    @Bind(R.id.radio_02_01_02)
    CheckBox radio020102;
    @Bind(R.id.radio_02_01_03)
    CheckBox radio020103;
    @Bind(R.id.radio_02_01_04)
    CheckBox radio020104;
    @Bind(R.id.radio_02_01_05)
    CheckBox radio020105;
    @Bind(R.id.radio_02_01_06)
    CheckBox radio020106;
    @Bind(R.id.radio_02_01_07)
    CheckBox radio020107;
    @Bind(R.id.radio_02_01_08)
    CheckBox radio020108;
    @Bind(R.id.radio_02_01_09)
    CheckBox radio020109;
    @Bind(R.id.radio_02_other_txt)
    EditText radio02OtherTxt;
    @Bind(R.id.iv_radio_02_other)
    LinearLayout ivRadio02Other;
    @Bind(R.id.iv_radio_02)
    LinearLayout ivRadio02;
    @Bind(R.id.radio_03_01)
    RadioButton radio0301;
    @Bind(R.id.radio_03_02)
    RadioButton radio0302;
    @Bind(R.id.radio_03)
    RadioGroup radio03;
    @Bind(R.id.radio_03_01_01)
    CheckBox radio030101;
    @Bind(R.id.radio_03_01_02)
    CheckBox radio030102;
    @Bind(R.id.radio_03_01_03)
    CheckBox radio030103;
    @Bind(R.id.radio_03_01_04)
    CheckBox radio030104;
    @Bind(R.id.radio_03_01_05)
    CheckBox radio030105;
    @Bind(R.id.radio_03_other_txt)
    EditText radio03OtherTxt;
    @Bind(R.id.iv_radio_03_other)
    LinearLayout ivRadio03Other;
    @Bind(R.id.iv_radio_03)
    LinearLayout ivRadio03;
    @Bind(R.id.radio_04_01)
    RadioButton radio0401;
    @Bind(R.id.radio_04_02)
    RadioButton radio0402;
    @Bind(R.id.radio_04)
    RadioGroup radio04;
    @Bind(R.id.radio_04_01_01)
    CheckBox radio040101;
    @Bind(R.id.radio_04_01_02)
    CheckBox radio040102;
    @Bind(R.id.radio_04_01_03)
    CheckBox radio040103;
    @Bind(R.id.radio_04_01_04)
    CheckBox radio040104;
    @Bind(R.id.radio_04_01_05)
    CheckBox radio040105;
    @Bind(R.id.radio_04_other_txt)
    EditText radio04OtherTxt;
    @Bind(R.id.iv_radio_04_other)
    LinearLayout ivRadio04Other;
    @Bind(R.id.iv_radio_04)
    LinearLayout ivRadio04;
    @Bind(R.id.radio_05_01)
    RadioButton radio0501;
    @Bind(R.id.radio_05_02)
    RadioButton radio0502;
    @Bind(R.id.radio_05)
    RadioGroup radio05;
    @Bind(R.id.radio_05_01_01)
    CheckBox radio050101;
    @Bind(R.id.radio_05_01_02)
    CheckBox radio050102;
    @Bind(R.id.radio_05_01_03)
    CheckBox radio050103;
    @Bind(R.id.radio_05_01_04)
    CheckBox radio050104;
    @Bind(R.id.radio_05_01_05)
    CheckBox radio050105;
    @Bind(R.id.radio_05_other_txt)
    EditText radio05OtherTxt;
    @Bind(R.id.iv_radio_05_other)
    LinearLayout ivRadio05Other;
    @Bind(R.id.iv_radio_05)
    LinearLayout ivRadio05;
    @Bind(R.id.radio_06_01)
    RadioButton radio0601;
    @Bind(R.id.radio_06_02)
    RadioButton radio0602;
    @Bind(R.id.radio_06)
    RadioGroup radio06;
    @Bind(R.id.radio_06_01_01)
    CheckBox radio060101;
    @Bind(R.id.radio_06_other_txt)
    EditText radio06OtherTxt;
    @Bind(R.id.iv_radio_06_other)
    LinearLayout ivRadio06Other;
    @Bind(R.id.iv_radio_06)
    LinearLayout ivRadio06;
    @Bind(R.id.radio_07_01)
    RadioButton radio0701;
    @Bind(R.id.radio_07_02)
    RadioButton radio0702;
    @Bind(R.id.radio_07)
    RadioGroup radio07;
    @Bind(R.id.radio_07_01_01)
    CheckBox radio070101;
    @Bind(R.id.radio_07_01_02)
    CheckBox radio070102;
    @Bind(R.id.radio_07_01_03)
    CheckBox radio070103;
    @Bind(R.id.radio_07_01_04)
    CheckBox radio070104;
    @Bind(R.id.radio_07_01_05)
    CheckBox radio070105;
    @Bind(R.id.radio_07_other_txt)
    EditText radio07OtherTxt;
    @Bind(R.id.iv_radio_07_other)
    LinearLayout ivRadio07Other;
    @Bind(R.id.iv_radio_07)
    LinearLayout ivRadio07;
    @Bind(R.id.radio_08_01)
    RadioButton radio0801;
    @Bind(R.id.radio_08_02)
    RadioButton radio0802;
    @Bind(R.id.radio_08)
    RadioGroup radio08;
    @Bind(R.id.radio_08_01_01)
    CheckBox radio080101;
    @Bind(R.id.radio_08_01_02)
    CheckBox radio080102;
    @Bind(R.id.radio_08_01_03)
    CheckBox radio080103;
    @Bind(R.id.radio_08_other_txt)
    EditText radio08OtherTxt;
    @Bind(R.id.iv_radio_08_other)
    LinearLayout ivRadio08Other;
    @Bind(R.id.iv_radio_08)
    LinearLayout ivRadio08;
    @Bind(R.id.radio_09_01)
    RadioButton radio0901;
    @Bind(R.id.radio_09_02)
    RadioButton radio0902;
    @Bind(R.id.radio_09)
    RadioGroup radio09;
    @Bind(R.id.radio_09_01_01)
    CheckBox radio090101;
    @Bind(R.id.radio_09_other_txt)
    EditText radio09OtherTxt;
    @Bind(R.id.iv_radio_09_other)
    LinearLayout ivRadio09Other;
    @Bind(R.id.iv_radio_09)
    LinearLayout ivRadio09;
    @Bind(R.id.radio_10_01)
    RadioButton radio1001;
    @Bind(R.id.radio_10_02)
    RadioButton radio1002;
    @Bind(R.id.radio_10)
    RadioGroup radio10;
    @Bind(R.id.radio_10_01_01)
    CheckBox radio100101;
    @Bind(R.id.radio_10_01_02)
    CheckBox radio100102;
    @Bind(R.id.radio_10_01_03)
    CheckBox radio100103;
    @Bind(R.id.radio_10_01_04)
    CheckBox radio100104;
    @Bind(R.id.radio_10_01_05)
    CheckBox radio100105;
    @Bind(R.id.radio_10_other_txt)
    EditText radio10OtherTxt;
    @Bind(R.id.iv_radio_10_other)
    LinearLayout ivRadio10Other;
    @Bind(R.id.iv_radio_10)
    LinearLayout ivRadio10;
    @Bind(R.id.radio_11_01)
    RadioButton radio1101;
    @Bind(R.id.radio_11_02)
    RadioButton radio1102;
    @Bind(R.id.radio_11)
    RadioGroup radio11;
    @Bind(R.id.radio_11_01_01)
    CheckBox radio110101;
    @Bind(R.id.radio_11_01_02)
    CheckBox radio110102;
    @Bind(R.id.radio_11_01_03)
    CheckBox radio110103;
    @Bind(R.id.radio_11_01_04)
    CheckBox radio110104;
    @Bind(R.id.radio_11_other_txt)
    EditText radio11OtherTxt;
    @Bind(R.id.iv_radio_11_other)
    LinearLayout ivRadio11Other;
    @Bind(R.id.iv_radio_11)
    LinearLayout ivRadio11;
    @Bind(R.id.radio_12_01)
    RadioButton radio1201;
    @Bind(R.id.radio_12_02)
    RadioButton radio1202;
    @Bind(R.id.radio_12)
    RadioGroup radio12;
    @Bind(R.id.radio_12_01_01)
    CheckBox radio120101;
    @Bind(R.id.radio_12_01_02)
    CheckBox radio120102;
    @Bind(R.id.radio_12_01_03)
    CheckBox radio120103;
    @Bind(R.id.radio_12_other_txt)
    EditText radio12OtherTxt;
    @Bind(R.id.iv_radio_12_other)
    LinearLayout ivRadio12Other;
    @Bind(R.id.iv_radio_12)
    LinearLayout ivRadio12;
    @Bind(R.id.radio_13_01)
    RadioButton radio1301;
    @Bind(R.id.radio_13_02)
    RadioButton radio1302;
    @Bind(R.id.radio_13)
    RadioGroup radio13;
    @Bind(R.id.radio_13_01_01)
    CheckBox radio130101;
    @Bind(R.id.radio_13_01_02)
    CheckBox radio130102;
    @Bind(R.id.radio_13_01_03)
    CheckBox radio130103;
    @Bind(R.id.radio_13_other_txt)
    EditText radio13OtherTxt;
    @Bind(R.id.iv_radio_13_other)
    LinearLayout ivRadio13Other;
    @Bind(R.id.iv_radio_13)
    LinearLayout ivRadio13;
    @Bind(R.id.radio_14_01)
    RadioButton radio1401;
    @Bind(R.id.radio_14_02)
    RadioButton radio1402;
    @Bind(R.id.radio_14)
    RadioGroup radio14;
    @Bind(R.id.radio_14_01_01)
    CheckBox radio140101;
    @Bind(R.id.radio_14_other_txt)
    EditText radio14OtherTxt;
    @Bind(R.id.iv_radio_14_other)
    LinearLayout ivRadio14Other;
    @Bind(R.id.iv_radio_14)
    LinearLayout ivRadio14;
    @Bind(R.id.radio_15_01)
    RadioButton radio1501;
    @Bind(R.id.radio_15_02)
    RadioButton radio1502;
    @Bind(R.id.radio_15)
    RadioGroup radio15;
    @Bind(R.id.radio_15_01_01)
    CheckBox radio150101;
    @Bind(R.id.radio_15_01_02)
    CheckBox radio150102;
    @Bind(R.id.radio_15_01_03)
    CheckBox radio150103;
    @Bind(R.id.radio_15_01_04)
    CheckBox radio150104;
    @Bind(R.id.radio_15_other_txt)
    EditText radio15OtherTxt;
    @Bind(R.id.iv_radio_15_other)
    LinearLayout ivRadio15Other;
    @Bind(R.id.iv_radio_15)
    LinearLayout ivRadio15;
    @Bind(R.id.radio_16_01)
    RadioButton radio1601;
    @Bind(R.id.radio_16_02)
    RadioButton radio1602;
    @Bind(R.id.radio_16)
    RadioGroup radio16;
    @Bind(R.id.radio_16_01_01)
    CheckBox radio160101;
    @Bind(R.id.radio_16_01_02)
    CheckBox radio160102;
    @Bind(R.id.radio_16_01_03)
    CheckBox radio160103;
    @Bind(R.id.radio_16_01_04)
    CheckBox radio160104;
    @Bind(R.id.radio_16_other_txt)
    EditText radio16OtherTxt;
    @Bind(R.id.iv_radio_16_other)
    LinearLayout ivRadio16Other;
    @Bind(R.id.iv_radio_16)
    LinearLayout ivRadio16;
    @Bind(R.id.radio_17_01)
    RadioButton radio1701;
    @Bind(R.id.radio_17_02)
    RadioButton radio1702;
    @Bind(R.id.radio_17)
    RadioGroup radio17;
    @Bind(R.id.radio_17_01_01)
    CheckBox radio170101;
    @Bind(R.id.radio_17_01_02)
    CheckBox radio170102;
    @Bind(R.id.radio_17_01_03)
    CheckBox radio170103;
    @Bind(R.id.radio_17_01_04)
    CheckBox radio170104;
    @Bind(R.id.radio_17_01_05)
    CheckBox radio170105;
    @Bind(R.id.radio_17_01_06)
    CheckBox radio170106;
    @Bind(R.id.radio_17_01_07)
    CheckBox radio170107;
    @Bind(R.id.radio_17_01_08)
    CheckBox radio170108;
    @Bind(R.id.radio_17_01_09)
    CheckBox radio170109;
    @Bind(R.id.radio_17_01_10)
    CheckBox radio170110;
    @Bind(R.id.iv_radio_17)
    LinearLayout ivRadio17;
    @Bind(R.id.radio_18_01)
    RadioButton radio1801;
    @Bind(R.id.radio_18_02)
    RadioButton radio1802;
    @Bind(R.id.radio_18)
    RadioGroup radio18;
    @Bind(R.id.radio_8_01_01)
    CheckBox radio80101;
    @Bind(R.id.radio_18_01_02)
    CheckBox radio180102;
    @Bind(R.id.radio_18_01_03)
    CheckBox radio180103;
    @Bind(R.id.radio_18_01_04)
    CheckBox radio180104;
    @Bind(R.id.radio_18_01_05)
    CheckBox radio180105;
    @Bind(R.id.radio_18_01_06)
    CheckBox radio180106;
    @Bind(R.id.radio_18_01_07)
    CheckBox radio180107;
    @Bind(R.id.iv_radio_18)
    LinearLayout ivRadio18;
    @Bind(R.id.radio_19_01)
    RadioButton radio1901;
    @Bind(R.id.radio_19_02)
    RadioButton radio1902;
    @Bind(R.id.radio_19)
    RadioGroup radio19;
    @Bind(R.id.radio_19_01_01)
    CheckBox radio190101;
    @Bind(R.id.radio_19_01_02)
    CheckBox radio190102;
    @Bind(R.id.radio_19_01_03)
    CheckBox radio190103;
    @Bind(R.id.radio_19_other_txt)
    EditText radio19OtherTxt;
    @Bind(R.id.iv_radio_19_other)
    LinearLayout ivRadio19Other;
    @Bind(R.id.iv_radio_19)
    LinearLayout ivRadio19;
    @Bind(R.id.radio_20_01)
    RadioButton radio2001;
    @Bind(R.id.radio_20_02)
    RadioButton radio2002;
    @Bind(R.id.radio_20)
    RadioGroup radio20;
    @Bind(R.id.radio_20_01_01)
    CheckBox radio200101;
    @Bind(R.id.radio_20_01_02)
    CheckBox radio200102;
    @Bind(R.id.radio_20_01_03)
    CheckBox radio200103;
    @Bind(R.id.radio_20_01_04)
    CheckBox radio200104;
    @Bind(R.id.radio_20_other_txt)
    EditText radio20OtherTxt;
    @Bind(R.id.iv_radio_20_other)
    LinearLayout ivRadio20Other;
    @Bind(R.id.iv_radio_23)
    LinearLayout ivRadio23;
    @Bind(R.id.radio_21_01)
    RadioButton radio2101;
    @Bind(R.id.radio_21_02)
    RadioButton radio2102;
    @Bind(R.id.radio_21)
    RadioGroup radio21;
    @Bind(R.id.radio_21_other_txt)
    EditText radio21OtherTxt;
    @Bind(R.id.radio_22_01)
    RadioButton radio2201;
    @Bind(R.id.radio_22_02)
    RadioButton radio2202;
    @Bind(R.id.radio_22)
    RadioGroup radio22;
    @Bind(R.id.radio_22_other_txt)
    EditText radio22OtherTxt;
    @Bind(R.id.radio_23_01)
    RadioButton radio2301;
    @Bind(R.id.radio_23_02)
    RadioButton radio2302;
    @Bind(R.id.radio_23)
    RadioGroup radio23;
    @Bind(R.id.radio_23_01_01)
    CheckBox radio230101;
    @Bind(R.id.radio_23_other_txt)
    EditText radio23OtherTxt;
    @Bind(R.id.iv_radio_23_other)
    LinearLayout ivRadio23Other;
    @Bind(R.id.iv_radio_20)
    LinearLayout ivRadio20;

    LoadingDialog loadingDialog;
    IBeforeAnesthesiaPresenter presenter;

    @Override
    public void setRootView() {
        setContentView(R.layout.act_beforeanesthesiastate);
        ButterKnife.bind(this);

    }

    @Override
    public void initData() {
        super.initData();
        loadingDialog = new LoadingDialog(this);
        presenter = new BeforeAnesthesiaPresenter(this, new BeforeAnesthesiaModel());
        setTitle();
        setContent();
    }

    private void setTitle() {
        tvPatientName.setText(AppConfig.BEFOREANSETHESIA.getObject().getVisit().getPatientName());
        if (AppConfig.BEFOREANSETHESIA.getObject().getVisit().getPatientSex().equals("1")) {
            tvPatientSex.setText("男");
        } else if (AppConfig.BEFOREANSETHESIA.getObject().getVisit().getPatientSex().equals("2")) {
            tvPatientSex.setText("女");
        } else {
            tvPatientSex.setText("不详");
        }
        tvPatientVisitno.setText("住院号" + AppConfig.BEFOREANSETHESIA.getObject().getVisit().getInHospitalNo());
        tvPatientDisease.setText(PreferenceHelper.readString(aty, AppConfig.PATIENT_INFO, AppConfig.PATIENT_DISEASE));
    }

    private void setContent() {
        for (BeforeAnesthesiaBean.ObjectEntity.VisitItemsEntity p : AppConfig.BEFOREANSETHESIA.getObject().getVisitItems()) {
            switch (p.getItemCode()) {
                case "xinXueGuan":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio0102.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio0101.setChecked(true);
                            ivRadio01.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio010101.setChecked(true);
                                        break;
                                    case "2":
                                        radio010102.setChecked(true);
                                        break;
                                    case "3":
                                        radio010103.setChecked(true);
                                        break;
                                    case "4":
                                        radio010104.setChecked(true);
                                        break;
                                    case "5":
                                        radio010105.setChecked(true);
                                        break;
                                    case "6":
                                        radio010106.setChecked(true);
                                        break;
                                    case "7":
                                        radio010107.setChecked(true);
                                        break;
                                    case "8":
                                        radio010108.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio010109.setChecked(true);
                                ivRadio01Other.setVisibility(View.VISIBLE);
                                radio01OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "FeiHeHuXi":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio0202.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio0201.setChecked(true);
                            ivRadio02.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio020101.setChecked(true);
                                        break;
                                    case "2":
                                        radio020102.setChecked(true);
                                        break;
                                    case "3":
                                        radio020103.setChecked(true);
                                        break;
                                    case "4":
                                        radio020104.setChecked(true);
                                        break;
                                    case "5":
                                        radio020105.setChecked(true);
                                        break;
                                    case "6":
                                        radio020106.setChecked(true);
                                        break;
                                    case "7":
                                        radio020107.setChecked(true);
                                        break;
                                    case "8":
                                        radio020108.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio020109.setChecked(true);
                                ivRadio02Other.setVisibility(View.VISIBLE);
                                radio02OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "MiNiaoXiTong":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio0302.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio0301.setChecked(true);
                            ivRadio03.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio030101.setChecked(true);
                                        break;
                                    case "2":
                                        radio030102.setChecked(true);
                                        break;
                                    case "3":
                                        radio030103.setChecked(true);
                                        break;
                                    case "4":
                                        radio030104.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio030105.setChecked(true);
                                ivRadio03Other.setVisibility(View.VISIBLE);
                                radio03OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "XiaoHua":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio0402.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio0401.setChecked(true);
                            ivRadio04.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio040101.setChecked(true);
                                        break;
                                    case "2":
                                        radio040102.setChecked(true);
                                        break;
                                    case "3":
                                        radio040103.setChecked(true);
                                        break;
                                    case "4":
                                        radio040104.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio040105.setChecked(true);
                                ivRadio04Other.setVisibility(View.VISIBLE);
                                radio04OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "ShenJingJiRou":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio0502.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio0501.setChecked(true);
                            ivRadio05.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio050101.setChecked(true);
                                        break;
                                    case "2":
                                        radio050102.setChecked(true);
                                        break;
                                    case "3":
                                        radio050103.setChecked(true);
                                        break;
                                    case "4":
                                        radio050104.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio050105.setChecked(true);
                                ivRadio05Other.setVisibility(View.VISIBLE);
                                radio05OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "XueYe":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio0602.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio0601.setChecked(true);
                            ivRadio06.setVisibility(View.VISIBLE);
                            if(p.getItemOther().length()>0)
                            {
                                radio060101.setChecked(true);
                                ivRadio06Other.setVisibility(View.VISIBLE);
                                radio06OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "NeiFenMiDaiXie":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio0702.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio0701.setChecked(true);
                            ivRadio07.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio070101.setChecked(true);
                                        break;
                                    case "2":
                                        radio070102.setChecked(true);
                                        break;
                                    case "3":
                                        radio070103.setChecked(true);
                                        break;
                                    case "4":
                                        radio070104.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio070105.setChecked(true);
                                ivRadio07Other.setVisibility(View.VISIBLE);
                                radio07OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "JingShen":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio0802.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio0801.setChecked(true);
                            ivRadio08.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio080101.setChecked(true);
                                        break;
                                    case "2":
                                        radio080102.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio080103.setChecked(true);
                                ivRadio08Other.setVisibility(View.VISIBLE);
                                radio08OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "ChanKe":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio0902.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio0901.setChecked(true);
                            ivRadio09.setVisibility(View.VISIBLE);
                            if(p.getItemOther().length()>0)
                            {
                                radio090101.setChecked(true);
                                ivRadio09Other.setVisibility(View.VISIBLE);
                                radio09OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "XiYanXuJiuYaoWuYiLai":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio1002.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio1001.setChecked(true);
                            ivRadio10.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio100101.setChecked(true);
                                        break;
                                    case "2":
                                        radio100102.setChecked(true);
                                        break;
                                    case "3":
                                        radio100103.setChecked(true);
                                        break;
                                    case "4":
                                        radio100104.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio100105.setChecked(true);
                                ivRadio10Other.setVisibility(View.VISIBLE);
                                radio10OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "GuoMinShiShouShuShi":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio1102.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio1101.setChecked(true);
                            ivRadio11.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio110101.setChecked(true);
                                        break;
                                    case "2":
                                        radio110102.setChecked(true);
                                        break;
                                    case "3":
                                        radio110103.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio110104.setChecked(true);
                                ivRadio11Other.setVisibility(View.VISIBLE);
                                radio11OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "JiWangMaZuiShi":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio1202.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio1201.setChecked(true);
                            ivRadio12.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio120101.setChecked(true);
                                        break;
                                    case "2":
                                        radio120102.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio120103.setChecked(true);
                                ivRadio12Other.setVisibility(View.VISIBLE);
                                radio12OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "JiaZuShiYiChuanBingShi":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio1302.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio1301.setChecked(true);
                            ivRadio13.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio130101.setChecked(true);
                                        break;
                                    case "2":
                                        radio130102.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio130103.setChecked(true);
                                ivRadio13Other.setVisibility(View.VISIBLE);
                                radio13OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "MuQianTeShuYaoWu":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio1402.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio1401.setChecked(true);
                            ivRadio14.setVisibility(View.VISIBLE);
                            if(p.getItemOther().length()>0)
                            {
                                radio140101.setChecked(true);
                                ivRadio14Other.setVisibility(View.VISIBLE);
                                radio14OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "QuanShenQingKuang":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio1502.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio1501.setChecked(true);
                            ivRadio15.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio150101.setChecked(true);
                                        break;
                                    case "2":
                                        radio150102.setChecked(true);
                                        break;
                                    case "3":
                                        radio150103.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio150104.setChecked(true);
                                ivRadio15Other.setVisibility(View.VISIBLE);
                                radio15OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "YiShiZhuangTai":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio1602.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio1601.setChecked(true);
                            ivRadio16.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio160101.setChecked(true);
                                        break;
                                    case "2":
                                        radio160102.setChecked(true);
                                        break;
                                    case "3":
                                        radio160103.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio160104.setChecked(true);
                                ivRadio16Other.setVisibility(View.VISIBLE);
                                radio16OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "QiDaoTongChangDu":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio1702.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio1701.setChecked(true);
                            ivRadio17.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio170101.setChecked(true);
                                        break;
                                    case "2":
                                        radio170102.setChecked(true);
                                        break;
                                    case "3":
                                        radio170103.setChecked(true);
                                        break;
                                    case "4":
                                        radio170104.setChecked(true);
                                        break;
                                    case "5":
                                        radio170105.setChecked(true);
                                        break;
                                    case "6":
                                        radio170106.setChecked(true);
                                        break;
                                    case "7":
                                        radio170107.setChecked(true);
                                        break;
                                    case "8":
                                        radio170108.setChecked(true);
                                        break;
                                    case "9":
                                        radio170109.setChecked(true);
                                        break;
                                    case "10":
                                        radio170110.setChecked(true);
                                        break;
                                }
                            }
                        }
                    }
                    break;
                case "YaChi":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio1802.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio1801.setChecked(true);
                            ivRadio18.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio80101.setChecked(true);
                                        break;
                                    case "2":
                                        radio180102.setChecked(true);
                                        break;
                                    case "3":
                                        radio180103.setChecked(true);
                                        break;
                                    case "4":
                                        radio180104.setChecked(true);
                                        break;
                                    case "5":
                                        radio180105.setChecked(true);
                                        break;
                                    case "6":
                                        radio180106.setChecked(true);
                                        break;
                                    case "7":
                                        radio180107.setChecked(true);
                                        break;
                                }
                            }
                        }
                    }
                    break;
                case "YanKe":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio1902.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio1901.setChecked(true);
                            ivRadio19.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio190101.setChecked(true);
                                        break;
                                    case "2":
                                        radio190102.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio190103.setChecked(true);
                                ivRadio19Other.setVisibility(View.VISIBLE);
                                radio19OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "MaZuiChuanCiBuWei":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio2002.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio2001.setChecked(true);
                            ivRadio20.setVisibility(View.VISIBLE);
                            for (int i =1;i<skin.length;i++)
                            {
                                switch (skin[i])
                                {
                                    case "1":
                                        radio200101.setChecked(true);
                                        break;
                                    case "2":
                                        radio200102.setChecked(true);
                                        break;
                                    case "3":
                                        radio200103.setChecked(true);
                                        break;
                                }
                            }
                            if(p.getItemOther().length()>0)
                            {
                                radio200104.setChecked(true);
                                ivRadio20Other.setVisibility(View.VISIBLE);
                                radio20OtherTxt.setText(p.getItemOther());
                            }
                        }
                    }
                    break;
                case "XiongBuXPian":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio2102.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio2101.setChecked(true);
                        }

                        if(p.getItemOther().length()>0)
                        {
                            radio21OtherTxt.setText(p.getItemOther());
                        }
                    }
                    break;
                case "XinDianTu":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio2202.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio2201.setChecked(true);
                        }

                        if(p.getItemOther().length()>0)
                        {
                            radio22OtherTxt.setText(p.getItemOther());
                        }
                    }
                    break;
                case "ShiFouBaoWei":
                    if(p.getItemValue().length() > 0) {
                        String[] skin = p.getItemValue().split(";", -1);
                        if(skin[0].equals("0"))
                        {
                            radio2302.setChecked(true);
                        }
                        else if(skin[0].equals("1"))
                        {
                            radio2301.setChecked(true);
                            ivRadio23.setVisibility(View.VISIBLE);
                        }

                        if(p.getItemOther().length()>0)
                        {
                            radio230101.setChecked(true);
                            ivRadio23Other.setVisibility(View.VISIBLE);
                            radio23OtherTxt.setText(p.getItemOther());
                        }
                    }
                    break;
            }
        }
    }

    @OnClick({R.id.titlebar_docadvice_img_back, R.id.radio_01_01, R.id.radio_01_02, R.id.radio_01_01_09,
            R.id.radio_02_01, R.id.radio_02_02, R.id.radio_02_01_09, R.id.radio_03_01, R.id.radio_03_02,
            R.id.radio_03_01_05, R.id.radio_04_01, R.id.radio_04_02, R.id.radio_04_01_05, R.id.radio_05_01,
            R.id.radio_05_02, R.id.radio_05_01_05, R.id.radio_06_01, R.id.radio_06_02, R.id.radio_06_01_01,
            R.id.radio_07_01, R.id.radio_07_02, R.id.radio_07_01_05, R.id.radio_08_01, R.id.radio_08_02,
            R.id.radio_08_01_03, R.id.radio_09_01, R.id.radio_09_02, R.id.radio_09_01_01, R.id.radio_10_01,
            R.id.radio_10_02, R.id.radio_10_01_05, R.id.radio_11_01, R.id.radio_11_02, R.id.radio_11_01_04,
            R.id.radio_12_01, R.id.radio_12_02, R.id.radio_12_01_03, R.id.radio_13_01, R.id.radio_13_02,
            R.id.radio_13_01_03, R.id.radio_14_01, R.id.radio_14_02, R.id.radio_14_01_01, R.id.radio_15_01,
            R.id.radio_15_02, R.id.radio_15_01_04, R.id.radio_16_01, R.id.radio_16_02, R.id.radio_16_01_04,
            R.id.radio_17_01, R.id.radio_17_02, R.id.radio_18_01, R.id.radio_18_02, R.id.radio_19_01,
            R.id.radio_19_02, R.id.radio_19_01_03, R.id.radio_20_01, R.id.radio_20_02, R.id.radio_20_01_04,
            R.id.radio_23_01, R.id.radio_23_02, R.id.radio_23_01_01, R.id.sure})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.titlebar_docadvice_img_back:
                finish();
                break;
            case R.id.radio_01_01:
                ivRadio01.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_01_02:
                ivRadio01.setVisibility(View.GONE);
                break;
            case R.id.radio_01_01_09:
                if(radio010109.isChecked()){
                    ivRadio01Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio01Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_02_01:
                ivRadio02.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_02_02:
                ivRadio02.setVisibility(View.GONE);
                break;
            case R.id.radio_02_01_09:
                if(radio020109.isChecked()){
                    ivRadio02Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio02Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_03_01:
                ivRadio03.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_03_02:
                ivRadio03.setVisibility(View.GONE);
                break;
            case R.id.radio_03_01_05:
                if(radio030105.isChecked()){
                    ivRadio03Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio03Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_04_01:
                ivRadio04.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_04_02:
                ivRadio04.setVisibility(View.GONE);
                break;
            case R.id.radio_04_01_05:
                if(radio040105.isChecked()){
                    ivRadio04Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio04Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_05_01:
                ivRadio05.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_05_02:
                ivRadio05.setVisibility(View.GONE);
                break;
            case R.id.radio_05_01_05:
                if(radio050105.isChecked()){
                    ivRadio05Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio05Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_06_01:
                ivRadio06.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_06_02:
                ivRadio06.setVisibility(View.GONE);
                break;
            case R.id.radio_06_01_01:
                if(radio060101.isChecked()){
                    ivRadio06Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio06Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_07_01:
                ivRadio07.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_07_02:
                ivRadio07.setVisibility(View.GONE);
                break;
            case R.id.radio_07_01_05:
                if(radio070105.isChecked()){
                    ivRadio07Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio07Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_08_01:
                ivRadio08.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_08_02:
                ivRadio08.setVisibility(View.GONE);
                break;
            case R.id.radio_08_01_03:
                if(radio080103.isChecked()){
                    ivRadio08Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio08Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_09_01:
                ivRadio09.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_09_02:
                ivRadio09.setVisibility(View.GONE);
                break;
            case R.id.radio_09_01_01:
                if(radio090101.isChecked()){
                    ivRadio09Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio09Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_10_01:
                ivRadio10.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_10_02:
                ivRadio10.setVisibility(View.GONE);
                break;
            case R.id.radio_10_01_05:
                if(radio100105.isChecked()){
                    ivRadio10Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio10Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_11_01:
                ivRadio11.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_11_02:
                ivRadio11.setVisibility(View.GONE);
                break;
            case R.id.radio_11_01_04:
                if(radio110104.isChecked()){
                    ivRadio11Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio11Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_12_01:
                ivRadio12.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_12_02:
                ivRadio12.setVisibility(View.GONE);
                break;
            case R.id.radio_12_01_03:
                if(radio120103.isChecked()){
                    ivRadio12Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio12Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_13_01:
                ivRadio13.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_13_02:
                ivRadio13.setVisibility(View.GONE);
                break;
            case R.id.radio_13_01_03:
                if(radio130103.isChecked()){
                    ivRadio13Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio13Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_14_01:
                ivRadio14.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_14_02:
                ivRadio14.setVisibility(View.GONE);
                break;
            case R.id.radio_14_01_01:
                if(radio140101.isChecked()){
                    ivRadio14Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio14Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_15_01:
                ivRadio15.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_15_02:
                ivRadio15.setVisibility(View.GONE);
                break;
            case R.id.radio_15_01_04:
                if(radio150104.isChecked()){
                    ivRadio15Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio15Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_16_01:
                ivRadio16.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_16_02:
                ivRadio16.setVisibility(View.GONE);
                break;
            case R.id.radio_16_01_04:
                if(radio160104.isChecked()){
                    ivRadio16Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio16Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_17_01:
                ivRadio17.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_17_02:
                ivRadio17.setVisibility(View.GONE);
                break;
            case R.id.radio_18_01:
                ivRadio18.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_18_02:
                ivRadio18.setVisibility(View.GONE);
                break;
            case R.id.radio_19_01:
                ivRadio19.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_19_02:
                ivRadio19.setVisibility(View.GONE);
                break;
            case R.id.radio_19_01_03:
                if(radio190103.isChecked()){
                    ivRadio19Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio19Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_20_01:
                ivRadio20.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_20_02:
                ivRadio20.setVisibility(View.GONE);
                break;
            case R.id.radio_20_01_04:
                if(radio200104.isChecked()){
                    ivRadio20Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio20Other.setVisibility(View.GONE);
                }
                break;
            case R.id.radio_23_01:
                ivRadio23.setVisibility(View.VISIBLE);
                break;
            case R.id.radio_23_02:
                ivRadio23.setVisibility(View.GONE);
                break;
            case R.id.radio_23_01_01:
                if(radio230101.isChecked()){
                    ivRadio23Other.setVisibility(View.VISIBLE);
                }else{
                    ivRadio23Other.setVisibility(View.GONE);
                }
                break;
            case R.id.sure:
                insertContent();
                break;
        }
    }

    private void insertContent() {
        for (int i = 0; i < AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().size(); i++) {
            String value="";
            switch (AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).getItemCode()) {
                case "xinXueGuan":
                    if(radio0102.isChecked())
                    {
                        value+="0";
                    }
                    if(radio0101.isChecked())
                    {
                        value+="1";
                    }
                    if(radio010101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio010102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio010103.isChecked())
                    {
                        value+=";3";
                    }
                    if(radio010104.isChecked())
                    {
                        value+=";4";
                    }
                    if(radio010105.isChecked())
                    {
                        value+=";5";
                    }
                    if(radio010106.isChecked())
                    {
                        value+=";6";
                    }
                    if(radio010107.isChecked())
                    {
                        value+=";7";
                    }
                    if(radio010108.isChecked())
                    {
                        value+=";8";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio010109.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio01OtherTxt.getText().toString());
                    }
                    break;
                case "FeiHeHuXi":
                    if(radio0202.isChecked())
                    {
                        value+="0";
                    }
                    if(radio0201.isChecked())
                    {
                        value+="1";
                    }
                    if(radio020101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio020102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio020103.isChecked())
                    {
                        value+=";3";
                    }
                    if(radio020104.isChecked())
                    {
                        value+=";4";
                    }
                    if(radio020105.isChecked())
                    {
                        value+=";5";
                    }
                    if(radio020106.isChecked())
                    {
                        value+=";6";
                    }
                    if(radio020107.isChecked())
                    {
                        value+=";7";
                    }
                    if(radio020108.isChecked())
                    {
                        value+=";8";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio020109.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio02OtherTxt.getText().toString());
                    }
                    break;
                case "MiNiaoXiTong":
                    if(radio0302.isChecked())
                    {
                        value+="0";
                    }
                    if(radio0301.isChecked())
                    {
                        value+="1";
                    }
                    if(radio030101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio030102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio030103.isChecked())
                    {
                        value+=";3";
                    }
                    if(radio030104.isChecked())
                    {
                        value+=";4";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio030105.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio03OtherTxt.getText().toString());
                    }
                    break;
                case "XiaoHua":
                    if(radio0402.isChecked())
                    {
                        value+="0";
                    }
                    if(radio0401.isChecked())
                    {
                        value+="1";
                    }
                    if(radio040101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio040102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio040103.isChecked())
                    {
                        value+=";3";
                    }
                    if(radio040104.isChecked())
                    {
                        value+=";4";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio040105.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio04OtherTxt.getText().toString());
                    }
                    break;
                case "ShenJingJiRou":
                    if(radio0502.isChecked())
                    {
                        value+="0";
                    }
                    if(radio0501.isChecked())
                    {
                        value+="1";
                    }
                    if(radio050101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio050102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio050103.isChecked())
                    {
                        value+=";3";
                    }
                    if(radio050104.isChecked())
                    {
                        value+=";4";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio050105.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio05OtherTxt.getText().toString());
                    }
                    break;
                case "XueYe":
                    if(radio0602.isChecked())
                    {
                        value+="0";
                    }
                    if(radio0601.isChecked())
                    {
                        value+="1";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio060101.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio06OtherTxt.getText().toString());
                    }
                    break;
                case "NeiFenMiDaiXie":
                    if(radio0702.isChecked())
                    {
                        value+="0";
                    }
                    if(radio0701.isChecked())
                    {
                        value+="1";
                    }
                    if(radio070101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio070102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio070103.isChecked())
                    {
                        value+=";3";
                    }
                    if(radio070104.isChecked())
                    {
                        value+=";4";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio070105.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio07OtherTxt.getText().toString());
                    }
                    break;
                case "JingShen":
                    if(radio0802.isChecked())
                    {
                        value+="0";
                    }
                    if(radio0801.isChecked())
                    {
                        value+="1";
                    }
                    if(radio080101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio080102.isChecked())
                    {
                        value+=";2";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio080103.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio08OtherTxt.getText().toString());
                    }
                    break;
                case "ChanKe":
                    if(radio0902.isChecked())
                    {
                        value+="0";
                    }
                    if(radio0901.isChecked())
                    {
                        value+="1";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio090101.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio09OtherTxt.getText().toString());
                    }
                    break;
                case "XiYanXuJiuYaoWuYiLai":
                    if(radio1002.isChecked())
                    {
                        value+="0";
                    }
                    if(radio1001.isChecked())
                    {
                        value+="1";
                    }
                    if(radio100101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio100102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio100103.isChecked())
                    {
                        value+=";3";
                    }
                    if(radio100104.isChecked())
                    {
                        value+=";4";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio100105.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio10OtherTxt.getText().toString());
                    }
                    break;
                case "GuoMinShiShouShuShi":
                    if(radio1102.isChecked())
                    {
                        value+="0";
                    }
                    if(radio1101.isChecked())
                    {
                        value+="1";
                    }
                    if(radio110101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio110102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio110103.isChecked())
                    {
                        value+=";3";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio110104.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio11OtherTxt.getText().toString());
                    }
                    break;
                case "JiWangMaZuiShi":
                    if(radio1202.isChecked())
                    {
                        value+="0";
                    }
                    if(radio1201.isChecked())
                    {
                        value+="1";
                    }
                    if(radio120101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio120102.isChecked())
                    {
                        value+=";2";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio120103.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio12OtherTxt.getText().toString());
                    }
                    break;
                case "JiaZuShiYiChuanBingShi":
                    if(radio1302.isChecked())
                    {
                        value+="0";
                    }
                    if(radio1301.isChecked())
                    {
                        value+="1";
                    }
                    if(radio130101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio130102.isChecked())
                    {
                        value+=";2";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio130103.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio13OtherTxt.getText().toString());
                    }
                    break;
                case "MuQianTeShuYaoWu":
                    if(radio1402.isChecked())
                    {
                        value+="0";
                    }
                    if(radio1401.isChecked())
                    {
                        value+="1";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio140101.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio14OtherTxt.getText().toString());
                    }
                    break;
                case "QuanShenQingKuang":
                    if(radio1502.isChecked())
                    {
                        value+="0";
                    }
                    if(radio1501.isChecked())
                    {
                        value+="1";
                    }
                    if(radio150101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio150102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio150103.isChecked())
                    {
                        value+=";3";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio150104.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio15OtherTxt.getText().toString());
                    }
                    break;
                case "YiShiZhuangTai":
                    if(radio1602.isChecked())
                    {
                        value+="0";
                    }
                    if(radio1601.isChecked())
                    {
                        value+="1";
                    }
                    if(radio160101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio160102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio160103.isChecked())
                    {
                        value+=";3";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio160104.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio16OtherTxt.getText().toString());
                    }
                    break;
                case "QiDaoTongChangDu":
                    if(radio1702.isChecked())
                    {
                        value+="0";
                    }
                    if(radio1701.isChecked())
                    {
                        value+="1";
                    }
                    if(radio170101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio170102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio170103.isChecked())
                    {
                        value+=";3";
                    }
                    if(radio170104.isChecked())
                    {
                        value+=";4";
                    }
                    if(radio170105.isChecked())
                    {
                        value+=";5";
                    }
                    if(radio170106.isChecked())
                    {
                        value+=";6";
                    }
                    if(radio170107.isChecked())
                    {
                        value+=";7";
                    }
                    if(radio170108.isChecked())
                    {
                        value+=";8";
                    }
                    if(radio170109.isChecked())
                    {
                        value+=";9";
                    }
                    if(radio170110.isChecked())
                    {
                        value+=";10";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    break;
                case "YaChi":
                    if(radio1802.isChecked())
                    {
                        value+="0";
                    }
                    if(radio1801.isChecked())
                    {
                        value+="1";
                    }
                    if(radio80101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio180102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio180103.isChecked())
                    {
                        value+=";3";
                    }
                    if(radio180104.isChecked())
                    {
                        value+=";4";
                    }
                    if(radio180105.isChecked())
                    {
                        value+=";5";
                    }
                    if(radio180106.isChecked())
                    {
                        value+=";6";
                    }
                    if(radio180107.isChecked())
                    {
                        value+=";7";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    break;
                case "YanKe":
                    if(radio1902.isChecked())
                    {
                        value+="0";
                    }
                    if(radio1901.isChecked())
                    {
                        value+="1";
                    }
                    if(radio190101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio190102.isChecked())
                    {
                        value+=";2";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio190103.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio19OtherTxt.getText().toString());
                    }
                    break;
                case "MaZuiChuanCiBuWei":
                    if(radio2002.isChecked())
                    {
                        value+="0";
                    }
                    if(radio2001.isChecked())
                    {
                        value+="1";
                    }
                    if(radio200101.isChecked())
                    {
                        value+=";1";
                    }
                    if(radio200102.isChecked())
                    {
                        value+=";2";
                    }
                    if(radio200103.isChecked())
                    {
                        value+=";3";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio200104.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio20OtherTxt.getText().toString());
                    }
                    break;
                case "XiongBuXPian":
                    if(radio2102.isChecked())
                    {
                        value+="0";
                    }
                    if(radio2101.isChecked())
                    {
                        value+="1";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio21OtherTxt.getText().length()>0)
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio21OtherTxt.getText().toString());
                    }
                    break;
                case "XinDianTu":
                    if(radio2202.isChecked())
                    {
                        value+="0";
                    }
                    if(radio2201.isChecked())
                    {
                        value+="1";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio22OtherTxt.getText().length()>0)
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio22OtherTxt.getText().toString());
                    }
                    break;
                case "ShiFouBaoWei":
                    if(radio2302.isChecked())
                    {
                        value+="0";
                    }
                    if(radio2301.isChecked())
                    {
                        value+="1";
                    }
                    AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemValue(value);
                    if(radio230101.isChecked())
                    {
                        AppConfig.BEFOREANSETHESIA.getObject().getVisitItems().get(i).setItemOther(radio23OtherTxt.getText().toString());
                    }
                    break;
            }
        }

        if (AppConfig.BEFOREANSETHESIA.getObject().getVisit().getVisitId() == null) {
            Map<String, String> params = new HashMap<>();
            params.put("operationNo", PreferenceHelper.readString(aty, AppConfig.PATIENT_INFO, AppConfig.PATIENT_OPERATION_ID) + "");
            params.put("saveData", JSON.toJSONString(AppConfig.BEFOREANSETHESIA));
            presenter.insertBeforeAnesthesiaDate(params);
        } else {
            Map<String, String> params = new HashMap<>();
            params.put("accountId", PreferenceHelper.readInt(aty, AppConfig.USER_INFO, AppConfig.USER_ACCOUNT) + "");
            params.put("fullName", PreferenceHelper.readString(aty, AppConfig.USER_INFO, AppConfig.USER_FULLNAME) + "");
            params.put("saveData", JSON.toJSONString(AppConfig.BEFOREANSETHESIA));
            presenter.updateBeforeAnesthesiaDate(params);
        }
    }

    @Override
    public void insertBeforeAnesthesiaDate(SubmitBean submitBean) {
        if (submitBean.getCode() == 200) {
            ViewInject.toast("保存成功");
            finish();
        } else {
            ViewInject.toast(submitBean.getDesc());
        }
    }

    @Override
    public void updateBeforeAnesthesiaDate(SubmitBean submitBean) {
        if (submitBean.getCode() == 200) {
            ViewInject.toast("保存成功");
            finish();
        } else {
            ViewInject.toast(submitBean.getDesc());
        }
    }

    @Override
    public void loadingDialogStatus(int status) {
        switch (status) {
            case AppConfig.SHOW_DIALOG:
                loadingDialog.setCanceledOnTouchOutside(false);
                loadingDialog.show();
                break;
            case AppConfig.DISMISS_DIALOG:
                loadingDialog.dismiss();
                break;

        }
    }

    /**
     * 通过dispatchTouchEvent每次ACTION_DOWN事件中动态判断非EditText本身区域的点击事件，然后在事件中进行屏蔽。然后当点击不是EditText时候，进行隐藏键盘操作
     *
     * @param ev
     * @return
     */

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
            View v = getCurrentFocus();
            if (isShouldHideInput(v, ev)) {

                InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                if (imm != null) {
                    imm.hideSoftInputFromWindow(v.getWindowToken(), 0);
                }
            }
            return super.dispatchTouchEvent(ev);
        }
        if (getWindow().superDispatchTouchEvent(ev)) {
            return true;
        }
        return onTouchEvent(ev);
    }

    public boolean isShouldHideInput(View v, MotionEvent event) {

        if (v != null && (v instanceof EditText)) {
            int[] leftTop = {0, 0};
            //获取输入框当前的location位置
            v.getLocationInWindow(leftTop);
            int left = leftTop[0];
            int top = leftTop[1];
            int bottom = top + v.getHeight();
            int right = left + v.getWidth();
            if (event.getX() > left && event.getX() < right
                    && event.getY() > top && event.getY() < bottom) {
                // 点击的是输入框区域，保留点击EditText的事件\
                return false;
            } else {
                return true;
            }
        }
        return false;
    }
}
